<?php
declare (strict_types=1);

namespace app\admin\validates;

use think\Validate;

/**
 * SysConfig验证器
 */
class SysConfigValidate extends Validate
{
    /**
     * 验证规则
     * @var array
     */
    protected $rule = [
        'key' => 'require|chsDash|max:32',
        'name' => 'require|chsDash|max:32',
        'appid' => 'require|max:32|alphaNum',
        'secret' => 'require|max:64|alphaNum',
        'token' => 'require|max:32|alphaNum',
        'qrcode' => 'require|max:255',
        'advert' => 'require|array',
        'aes_key' => 'require|max:64|alphaNum',
        'douyin_client_key' => 'require|max:255',
        'douyin_redirect_uri' => 'require|max:255',
        //数据大屏
        'data_center_start' => 'require|number',
        'data_center_out_bag_num' => 'require|number',
        //备注
        'remark' => 'require|max:255',
    ];

    /**
     * 验证场景
     * @var array
     */
    protected $scene = [
        'WsOpenPlatform' => ['key', 'name', 'appid', 'secret', 'aes_key', 'token', 'remark'],
        'WsOfficialAccount' => ['key', 'name', 'appid', 'secret', 'token', 'qrcode', 'remark'],
        'WsScanBag' => ['key', 'douyin_client_key', 'douyin_redirect_uri', 'remark'],
        'DataCenter' => ['key', 'data_center_start', 'data_center_out_bag_num', 'remark'],
    ];


}
